Skip to content

Conversation

@sunamo
Copy link

@sunamo sunamo commented Aug 20, 2025

No description provided.

Copilot AI review requested due to automatic review settings August 20, 2025 21:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds methods to get and set multi-line text data from the clipboard by providing convenient array-based APIs. The implementation treats clipboard text as lines that can be split and joined using standard line terminators.

  • Adds GetLines() and GetLinesAsync() methods that retrieve clipboard text and split it into string arrays
  • Adds SetLines() and SetLinesAsync() methods that join string arrays and set them as clipboard text
  • Uses standard line separators (\r\n, \r, \n) for splitting and Environment.NewLine for joining

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

/// Clears the Clipboard and then adds lines of text data to it.
/// </summary>
public static Task SetLinesAsync(string[] lines, Cancellation cancellation = default)
{
Copy link

Copilot AI Aug 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method should validate that the lines parameter is not null to prevent a NullReferenceException when calling string.Join().

Suggested change
{
{
if (lines == null)
throw new ArgumentNullException(nameof(lines));

Copilot uses AI. Check for mistakes.
/// Clears the Clipboard and then adds lines of text data to it.
/// </summary>
public static void SetLines(string[] lines)
{
Copy link

Copilot AI Aug 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method should validate that the lines parameter is not null to prevent a NullReferenceException when calling string.Join().

Suggested change
{
{
if (lines == null)
throw new ArgumentNullException(nameof(lines));

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant